import {
    SET_MENU_LIST
} from '../constant'
// import { nanoid } from 'nanoid'

//初始化菜单的列表
const initState = JSON.parse(localStorage.getItem('menuList'))

export default function menuReducer(preState = initState, action) {
	const {type,data = []} = action
	switch (type) {
        case SET_MENU_LIST:
            return [...data]
            // return preState
		default:
			return preState
	}
}
